﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;

/// <summary>
/// Summary description for Connect
/// </summary>
public class Connect
{
    SqlConnection sqlConnect;
    String conn = "Data Source=HUNTER1189-PC;Initial Catalog=G6_Online_Banking;Persist Security Info=True;User ID=sa;Password=sasa";

	public Connect()
	{
        sqlConnect = new SqlConnection(conn);
	}

    public SqlConnection GetConnect()
    {
        if (sqlConnect.State == System.Data.ConnectionState.Closed)
        {
            sqlConnect.Open();
        }
        return sqlConnect;
    }

    public SqlConnection CloseConnect()
    {
        if (sqlConnect.State == System.Data.ConnectionState.Open)
        {
            sqlConnect.Close();
        }
        return sqlConnect;
    }
}
